package com.test.lucene.helper;

import org.apache.commons.cli.Options;

/**
 * Read the command line and return the parameters.
 * 
 * @author Patrick Kimber
 * 
 */
public final class SearchParameters extends SharedParameters {

    /**
     * Constructor.
     * 
     * @param name
     *            The name of the main class.
     * @param params
     *            Command line parameters.
     */
    public SearchParameters(final String name, final String[] params) {
        super(name, params);
    }

    /**
     * Has the user specified the correct command line parameters?
     * 
     * @return <code>true</code> If the user has displayed the correct command
     *         line parameters.
     */
    public boolean isValid() {
        boolean result = getCommandLine().hasOption(OPTION_REPOSITORY)
                && getCommandLine().hasOption(OPTION_MINUTES);
        return result;
    }

    /**
     * Get the options for the application.
     * 
     * @return The command line options.
     */
    protected Options getOptions() {
        return getSharedOptions();
    }
}
